# encoding: utf-8
import os
import platform
import time

# 当前操作系统
currOS = platform.system()

# 浏览器
browser = 'chrome'

# 当前时间
now = time.strftime('%Y-%m-%d_%H_%M_%S', time.localtime(time.time()))
today = time.strftime('%Y-%m-%d', time.localtime(time.time()))

# 框架根目录
frame_path = os.path.dirname(os.path.split(os.path.realpath(__file__))[0])

# 浏览器驱动
if currOS == "Darwin":
    driver_file = frame_path + "/web/drivers/chromedriver"
else:
    driver_file = frame_path + "\\web\\drivers\\chromedriver.exe"

# 日志
if currOS == "Darwin":
    logs_path = frame_path + '/logs/' + today + '/'
else:
    logs_path = frame_path + '\\logs\\' + today + '\\'
if not os.path.exists(logs_path):
    os.mkdir(logs_path)
logs_file = logs_path + time.strftime("%Y-%m-%d_%H", time.localtime(time.time())) + '.log'

# 测试用例目录
if currOS == "Darwin":
    testcase_path = frame_path + '/web/testcase'
else:
    testcase_path = frame_path + '\\web\\testcase'

# 测试数据
if currOS == "Darwin":
    datas_file = frame_path + '/datas/demo.xlsx'
else:
    datas_file = frame_path + '\\datas\\demo.xlsx'

# 元素对象库
if currOS == "Darwin":
    object_lib = frame_path + "/web/objects/objects_demo.yaml"
else:
    object_lib = frame_path + "\\web\\objects\\objects_demo.yaml"

# 测试报告
if currOS == "Darwin":
    report_path = frame_path + '/result/' + today + '/'
else:
    report_path = frame_path + '\\result\\' + today + '/'

if not os.path.exists(report_path):
    os.mkdir(report_path)
report_file = report_path + now + '.html'

# 测试报告参数
reporttitle = 'demo项目_自动化测试报告'
description = '测试集执行情况如下'  # 在测试报告隐藏了，暂时废弃了
tester = "LiuYong"  # 测试人员
